{	Problem: http://codeforces.ru/problemset/problem/44/D
	Verdict: Accepted
}
uses 
  SysUtils, Math;
    
var 
    i,j,n,kk,xx,yy,zz:longint;
    x,y,z:array[0..5010] of longint;
    d:array[0..5010] of double;
    dd,ans:double;

begin
read(n);
for i:=1 to n do begin
    read(x[i],y[i],z[i]);
    xx:=x[i]-x[1];
    yy:=y[i]-y[1];
    zz:=z[i]-z[1];
    d[i]:=sqrt(xx*xx+yy*yy+zz*zz);
end;
ans:=1e12;
kk:=n-1;
for i:=2 to kk do begin
    for j:=i+1 to n do begin
        xx:=x[i]-x[j];
        yy:=y[i]-y[j];
        zz:=z[i]-z[j];
        dd:=d[i]+d[j]+sqrt(xx*xx+yy*yy+zz*zz);
        ans:=min(dd,ans);
    end;
end;
ans:=ans/2;
write(ans:0:6);
end.